#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <malloc.h>

struct stu
{
	char name[10];
	int age;
};

typedef struct son
{
	char name[10];
	int age;
}son;

void main()
{
	struct stu student1;
	struct stu * p;
	son * pson;

	strcpy(student1.name, "xiaozhi");
	student1.age = 35;
	printf("student1 name is : %s\n",student1.name);
	printf("student1 age is : %d\n",student1.age);

	p = (struct stu *) malloc (sizeof(struct stu));
	strcpy(p->name, "zixi");
	p->age = 2;
	printf("student2 name is : %s\n",p->name);
	printf("student2 age is : %d\n",p->age);

	pson = (son *) malloc (sizeof (son));
	strcpy(pson->name, "zhen");
	pson->age = 3;

	printf("son name is : %s\n",pson->name);
	printf("son age is : %d\n",pson->age);

	free(p);
	free(pson);
	p = NULL;
	pson = NULL;

}
